package com.thinkgem.jeesite.common.frame.rpc.annotation;

import java.lang.reflect.Method;

/**
 * Created by liufeng on 2016/6/6.
 */
public class RPCBeanDefinition {

    private String name;
    private Class<?> classRef;
    private Method methodRef;
    private double version;


    public String getName() {
        return name;
    }

    public Class<?> getClassRef() {
        return classRef;
    }

    public Method getMethodRef() {
        return methodRef;
    }

    public double getVersion() {
        return version;
    }

    public static class Builder{

        private String name;
        private Class<?> classRef;
        private Method methodRef;
        private double version;

        public Builder addName(String name){
            this.name = name;
            return this;
        }

        public Builder addClassRef(Class<?> classRef){
            this.classRef = classRef;
            return this;
        }

        public Builder addMethodRef(Method methodRef){
            this.methodRef = methodRef;
            return this;
        }
        public Builder addVersion(double version){
            this.version = version;
            return this;
        }

        public RPCBeanDefinition builder(){
            return new RPCBeanDefinition(this);
        }

    }

    public RPCBeanDefinition(Builder builder){
        this.name=builder.name;
        this.classRef = builder.classRef;
        this.methodRef = builder.methodRef;
        this.version = builder.version;

    }
}
